package cn.snmp.mutual.uk.stack;

import java.io.*;

public class GetBulkPdu extends Pdu {
    private static final String version_id = "@(#)$Id: GetBulkPdu.java,v 3.17 2006/02/09 14:30:19 birgit Exp $ Copyright Westhawk Ltd";
    protected int non_repeaters;
    protected int max_repetitions;

    public GetBulkPdu(final SnmpContextBasisFace con) {
        super(con);
        this.non_repeaters = 0;
        this.max_repetitions = 0;
        this.setMsgType((byte) (-91));
    }

    public void setNonRepeaters(final int no) {
        this.non_repeaters = no;
    }

    public int getNonRepeaters() {
        return this.non_repeaters;
    }

    public void setMaxRepetitions(final int no) {
        this.max_repetitions = no;
    }

    @Deprecated
    public void setMaxRepititions(final int no) {
        this.setMaxRepetitions(no);
    }

    public int getMaxRepetitions() {
        return this.max_repetitions;
    }

    @Override
    public boolean send() throws IOException, PduException {
        return this.send(this.non_repeaters, this.max_repetitions);
    }

    @Override
    public String toString() {
        final StringBuffer buffer = new StringBuffer(super.toString());
        final int l = buffer.length();
        buffer.setLength(l - 1);
        buffer.append(", non_rep=").append(this.getNonRepeaters());
        buffer.append(", max_rep=").append(this.getMaxRepetitions());
        buffer.append("]");
        return buffer.toString();
    }
}
